<?php
$v_agency_id = '';
if(isset($_REQUEST['hdn_back_agency_id'])){
	$v_agency_id = trim($_REQUEST['hdn_back_agency_id']);
}
$v_cate_id = 0;
if(isset($_REQUEST['hdn_back_cate_id'])){
	$v_cate_id = intval(trim($_REQUEST['hdn_back_cate_id']));
}
$v_filter = '';
if(isset($_REQUEST['hdn_filter'])){
	$v_filter = $_REQUEST['hdn_filter'];
}
$v_filter='%'.$v_filter.'%';
$v_method = 1;
if(isset($_REQUEST['hdn_method'])){	
	$v_method = $_REQUEST['hdn_method'];
}
$v_status = -1;
if (isset($_REQUEST['hdn_status']))
{
	$v_status = $_REQUEST['hdn_status'];
}
if(_is_sqlserver()){
	$cmd = @mssql_init("Onegate_AFGetAll", $conn);
	@mssql_bind($cmd, "@p_status", $v_status, SQLINT4);
	@mssql_bind($cmd, "@p_method", $v_method, SQLINT4);
	@mssql_bind($cmd, "@p_filter", $v_filter, SQLVARCHAR);
	@mssql_bind($cmd, "@p_agency_id", $v_agency_id, SQLVARCHAR);
	@mssql_bind($cmd, "@p_cate_id", $v_cate_id, SQLINT4);
	//Lay danh sach thuat ngu ra recordset
	$rs_all_af = @mssql_execute($cmd);
	//Lay cac thuat ngu ra recordset
	$arr_all_af = _get_row_to_array($rs_all_af); 
	@mssql_free_result($rs_all_af);
}
?>